<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
<title>拆开有惊喜</title>
<link rel="stylesheet" href="{MOBILE_URL}/css/chaikai.css" />
<script src="{MOBILE_URL}/js/jquery.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type='text/javascript' src="{MOBILE_URL}/js/jquery.blockUI.js"></script>
<script>


{php $signPackage=$_W['account']['jssdkconfig'];}	



 

{php $signPackage=$_W['account']['jssdkconfig'];}	
wx.config({
	debug: false,   
	appId: '<?php echo $signPackage["appId"];?>',
	timestamp: '<?php echo $signPackage["timestamp"];?>',
	nonceStr: '<?php echo $signPackage["nonceStr"];?>',
	signature: '<?php echo $signPackage["signature"];?>',
	jsApiList: ['checkJsApi','onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','onMenuShareWeibo',]
});

var user_image="{$fromUserJson['user_image']}";
var user_name="{$fromUserJson['user_name']}";

var title="{$settings['sharetitle']}".replace("{fromuser}",user_name);
var desc="{$settings['sharedescription']}".replace("{fromuser}",user_name);

wx.ready(function () {
	var shareData = {
		title: title,
		desc: desc,
		link: "{$settings['shareurl']}&wechatId={$fromUser}",
		//imgUrl: '{$_W['attachurl']}{$settings['shareimage']}',
		imgUrl: user_image,
		trigger: function (res) {},
		complete: function (res) {},
		success: function (res) {
		 //zzlog();
		},
		cancel: function (res) {
		},
		fail: function (res) {
		}
	};
	wx.onMenuShareAppMessage(shareData);
	wx.onMenuShareQQ(shareData);
	wx.onMenuShareWeibo(shareData);
	wx.onMenuShareTimeline(shareData);
});




$(document).ready(function(){
	$(function(){
	/* 	$.post("{php echo $this->createMobileUrl('sendhb',array('op'=>'check'));}",function(data){
			if(data==1){
				$(".second-box").show();
				$('.second-box .money1').show();
				return;
			}
			if(data==2){
				$(".second-box").show();
				$('.second-box .money2').show();
				return;
			}
			if(data==3){
				$(".second-box").show();
				$('.second-box .money6').show();
				return;
			}
			if(data==4){
				$(".first-box").show();
				return;
			}
		}); */
	})
	
	$(".hot-click").click(function(){
		$.blockUI({ message:"强拆中，请耐心等待..."});
		 $.post("{php echo $this->createMobileUrl('sendhb',array('op'=>'caikai'));}",{ucode:"ozZaEuKrU17siPRUIjsB0sA9ZNKA"},function(data){
			  $.unblockUI();
			 var code=data.code;
		      if (code==6){
		        alert(data.message);
		        return;
		      }
		 
		     $(".first-box").hide();
		     $(".second-box").show();
			 if(code==1){
				 $('.second-box .money1').show();
				 return false;
			 }
			 if(code==2){
				 $('.second-box .money2').show();
				 return false;
			 }
			 if(code==4){
				$('.second-box .money4').show();
			    return false;	 
			 }
			 
			 if(code==6){
			   $('.second-box .money6').show();
				return false;	 
		     }
			// alert(code);
			  $('.hot-click').unbind();
			 $('.second-box .money3 .money-number').text(data.amount);
             $('.second-box .money3').show();
		 },"json");
	});
	
	$('.sendMoney').click(function(){
		$(".share").show();
	})
	$(".close").click(function(){
		$(".share").fadeTo(500,0,function(){
			$(".share").hide();
		});
	});
});
</script>
</head>
<body>

<div class="first-box" style="display:"> 
  <img class="body" src="{MOBILE_URL}/images/fools_1.png">
  <img class="user-headimg" src="{MOBILE_URL}/images/hbss_icon.jpg">
  <div class="hot-click"></div>
  <div class="nickname">{$settings['name']}的赠礼</div>
</div>

<div class="second-box" style="display:none">
  <div class="second-wrapper"> 
    <img class="second-bg" src="{MOBILE_URL}/images/fools_2.png"> 
    <img class="second-headimg" src="132">
    <div class="second-nickname">
	   {$settings['name']}的赠礼
       <p style="font-size:13px; color:#999999">恭喜发财，大吉大利！</p>
    </div>
    <!--ucode错误-->
    <div class="money1"><p style="color:rgb(214, 86, 69);font-size:1.2em;">发送“H”给“ {$settings['name']}”公众号,领取赠礼</p></div>
    <!--领取过了-->
    <div class="money2">
      <div class="needMore">
        <p style="color:rgb(214, 86, 69);font-size:1.2em;">你已经领取过了，快去发礼物吧，也许会有意想不到的惊喜哦~</p>
        <a href="javascript:void(0);" class="lg-btn sendMoney">立即发礼物</a>
      </div>
    </div>
    <!--领取成功-->
    <div class="money3"><span class="money-number"></span> <span class="yuan">元</span> 
      <p style="color:#70A0D7;font-size:1em;">已存入零钱,可直接提现</p>
      <p>还想要?告诉你个秘密...</p>
      <p style="color:rgb(214, 86, 69);font-size:1.2em;">快去发礼物哦~也许会有意想不到的惊喜哦~</p>
      <a href="javascript:void(0);" class="lg-btn sendMoney">立即发礼物</a>
    </div>
    <!--系统错误-->
    <div class="money4">
      <p style="color:rgb(214, 86, 69);font-size:1.2em;">系统错误</p>
    </div>
    <!--没有钱了-->
    <div class="money6">
       <p style="color:rgb(214, 86, 69);font-size:1.2em;">对不起来礼物被领光了。</p>
       <a href="javascript:void(0);" class="lg-btn sendMoney">立即发礼物</a>
    </div>
   
  </div>
</div>
<div class="share" style="display:none"> <span class="share-p">去发礼物吧！</span> 
  <img class="pointer" src="{MOBILE_URL}/images/share_arrow.gif"> 
  <img class="close" src="{MOBILE_URL}/images/close-black.gif"> 
</div>
</body>
</html>